import request from '../utils/request';

export const userMenuList = query => {
    return request({
        url: '/sysMenu/queryCurrentUserMenuList',
        method: 'get',
        params: query
    });
};

export const allSysMenuList = query => {
    return request({
        url: '/sysMenu/queryMenuTreeList',
        method: 'get',
        params: query
    });
};

export const allSysMenuByRoleList = query => {
    return request({
        url: '/sysMenu/queryMenuTreeByRoleIdList',
        method: 'get',
        params: query
    });
};

export const sysMenuList = query => {
    return request({
        url: '/sysMenu/queryMenuList',
        method: 'get',
        params: query
    });
};

export const saveSysMenu = data => {
    return request({
        url: '/sysMenu/save',
        method: 'post',
        data: data
    });
};

export const updateSysMenu = data => {
    return request({
        url: '/sysMenu/update',
        method: 'put',
        data: data
    });
};

export const delSysMenu = data => {
    return request({
        url : '/sysMenu/delete/' + data,
        method: 'delete'
    });
};
